<?php

use think\Cache;
use think\migration\Seeder;

class AddAppFormStatus extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
        $configModel = new \app\admin\model\Config();
        if ($configModel->getSealAppFormStatues() == null) {
            $caches = [
                'name'     => \app\admin\common\Constants::$SEAL_APPY_FORM_STATUS_KEY,
                'title'    => '印章申请状态',
                'type'     => 3,
                'group_id' => 2,
                'value'    => '1|提交中' . PHP_EOL . '2|审核中' . PHP_EOL . '3|已拒绝' . PHP_EOL . '4|审核完成'. PHP_EOL . '5|用章完成',
                'remark'   => '印章申请状态配置',
                'sort'     => 1
            ];
            $this->table("config")->insert($caches)->save();
            Cache::clear();
        }
    }
}